package my.test.facade;

/**
 * @Author 许玉康
 * @Date 2019/9/29 9:02
 * 扩展后的现代化邮局
 */
public class ModenPostOffice2 {

    private ILetterProcess letterProcess = new LetterProcessImpl();
    private Police letterPolice = new Police();

    //写信，封装，投递，一体化
    public void sendLetter(String context, String address) {
            //帮你写信
            letterProcess.writeContext(context);
            //写好信封
            letterProcess.fillEnvelope(address);
            //警察要检查信件
            letterPolice.checkLetter(letterProcess);
            //把信放到信封里
            letterProcess.letterInotoEnvelope();
            //投递邮件
            letterProcess.sendLetter();
        }

    }
